]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
Revert "status/bluetooth: Bail out and hide UI when there's no adapter"
authorJonas Dreßler <verdre@v0yd.nl>
Thu, 24 Feb 2022 17:57:22 +0000 (18:57 +0100)
committerMarge Bot <marge-bot@gnome.org>
Sat, 26 Feb 2022 15:53:19 +0000 (15:53 +0000)
Turns out this broke showing the bluetooth menu entry for adapters which
rely on the had-devices-setup property being set while turned off. These
adapters are completely removed from the system by the firmware after
powering them off, so in that case there is no default adapter anymore,
although we still want to show the menu.

This reverts commit aaf47167b5bb2a4ac15e2cdfdfcac71498dcd7c7.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2214>

js/ui/status/bluetooth.js

index 39c2ab62ca94e40a3b68fdef2c6a9b32b0504c50..187e1063576c9ed78103646ac42ec17c3d7b57fb 100644 (file)
@@ -129,20 +129,13 @@ class Indicator extends PanelMenu.SystemIndicator {
     }
 
     _sync() {
-        const adapterJustAppeared = !this._adapter && this._client.default_adapter;
-        this._adapter = this._client.default_adapter ?? null;
-        if (!this._adapter) {
-            this._item.visible = false;
-            this._indicator.visible = false;
-            return;
-        }
-
         const devices = this._getDeviceInfos();
         const connectedDevices = devices.filter(dev => dev.connected);
         const nConnectedDevices = connectedDevices.length;
 
-        if (!adapterJustAppeared)
+        if (this._client.default_adapter && this._adapter)
             this._setHadSetupDevices(devices.length > 0);
+        this._adapter = this._client.default_adapter ?? null;
 
         let sensitive = !Main.sessionMode.isLocked && !Main.sessionMode.isGreeter;